package echo;



/**
 * The test class CalculadoraTest.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class CalculadoraTest extends junit.framework.TestCase
{
    private echo.Calculadora calculad1;

    /**
     * Default constructor for test class CalculadoraTest
     */
    public CalculadoraTest()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    protected void setUp()
    {
        calculad1 = new echo.Calculadora();
        
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    protected void tearDown()
    {
    }

    public void testeEntra1()
    {
		calculad1.limpa();        
        assertEquals("1", calculad1.entraUm());
    }

    public void testaEntra11()
    {
		calculad1.limpa();        
        calculad1.entraUm();
        assertEquals("11", calculad1.entraUm());
    }

    public void testaEntra111()
    {
        calculad1.limpa();
        calculad1.entraUm();
        calculad1.entraUm();
        assertEquals("111", calculad1.entraUm());
    }

    public void testaLimpaSoma()
    {
        calculad1.limpa();
        assertEquals("0", calculad1.comandoSoma());
    }

    public void testaEntra1Soma()
    {
        calculad1.limpa();      
        calculad1.entraUm();
        assertEquals("1", calculad1.comandoSoma());
    }

    public void testaEntra1SomaEntra1Soma()
    {
        calculad1.limpa();
        calculad1.entraUm();
        calculad1.comandoSoma();
        calculad1.entraUm();
        assertEquals("2", calculad1.comandoSoma());
    }

	public void testaEntra111SomaEntra11SomaEntra1Soma()
	{
		calculad1.limpa();
		calculad1.entraUm();
  	    calculad1.entraUm();
		calculad1.entraUm();
		calculad1.comandoSoma();
  	    calculad1.entraUm();
		calculad1.entraUm();
		calculad1.comandoSoma();
		calculad1.entraUm();
 	    assertEquals("123", calculad1.comandoSoma());
	}
}








